package com.lagou.dubbo.service.impl;


import com.lagou.dubbo.service.DubboSleepService;
import org.apache.dubbo.config.annotation.Service;

import java.util.Random;

@Service
public class DubboSleepServiceImpl implements DubboSleepService {
    @Override
    public void methodA() {
        sleep();
    }

    @Override
    public void methodB() {
        sleep();
    }

    @Override
    public void methodC() {
        sleep();
    }

    private void sleep() {
        int time = new Random().nextInt(101);
        try {
            Thread.sleep(time);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }
}
